package com.example.generictest.servce;

import com.example.generictest.bean.Student;

/**
 * @author lee
 * @date 2022年03月15日 17:47
 */
public class SayImpl<C> implements Say<C>{
    @Override
    public void sayHello(C t) {
        if (t instanceof Student) {
            Integer age = ((Student) t).getAge();
            System.out.println("my type is student my age is " + age);
        }else{
            System.out.println(t + "  say hello world");
        }

    }

    @Override
    public <C> C testReturn(C c) {
        return c;
    }


}
